package com.haier.controller.manager;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.haier.dto.HpAreaAuditorDto;
import com.haier.service.IHpAreaAuditorService;
import com.haier.utils.EmptyUtils;
import com.haier.vo.ResponseVo;

@RestController
@RequestMapping(value = "/hipassjava/manager/hpAreaAuditor")
public class ManagerHpAreaAuditorContoller {
	private static final Logger logger = LoggerFactory.getLogger(ManagerHpAreaAuditorContoller.class);
	@Autowired
	private IHpAreaAuditorService iHpAreaAuditorService;

	/**
	 * 添加/修改
	 */
	@RequestMapping(value = "/edit", method = RequestMethod.POST)
	public Object edit(@RequestBody HpAreaAuditorDto dto) {
		try {
			return iHpAreaAuditorService.edit(dto);
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			return ResponseVo.error();
		}
	}

	/**
	 * 删除
	 */
	@RequestMapping(value = "/remove", method = RequestMethod.POST)
	public Object remove(@RequestBody HpAreaAuditorDto dto) {
		try {
			if (EmptyUtils.isEmpty(dto.getId())) {
				return ResponseVo.checkError("ID不能为空");
			}
			return iHpAreaAuditorService.remove(dto);
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			return ResponseVo.error();
		}
	}

}
